#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;

int main()
{
    set<int>li;
    int tel[11];
    for (int i=0;i<11;i++)
    {   
        char c;
        cin>>c; 
        tel[i]=c-'0';       
        li.insert(c-'0');
    }
    vector<int>nums(li.begin(),li.end());
    reverse(nums.begin(),nums.end());
    int res[10];
    for (int i=0;i<nums.size();i++)
        res[nums[i]]=i;
    cout<<"int[] arr = new int[]{";
    for (int i=0;i<nums.size();i++)
    {
        if (i==0)
            cout<<nums[i];
        else
            cout<<","<<nums[i];
    }
    cout<<"};\nint[] index = new int[]{";
    for (int i=0;i<11;i++)
    {
        if (i==0)
            cout<<res[tel[i]];
        else
            cout<<","<<res[tel[i]];
    }
    cout<<"};";
}